package com.techsoul.module.basic.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.techsoul.module.basic.pojo.entity.Warehouse;
import com.techsoul.module.basic.pojo.param.WarehouseSearchParam;
import com.techsoul.module.basic.pojo.vo.WarehouseVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 仓库Mapper接口
 * 
 * @author liuen
 * @date 2021-01-26
 */
public interface WarehouseMapper extends BaseMapper<Warehouse> {

    /**
     * 详情
     * @param id
     * @return
     */
    WarehouseVo findById(String id);
    Warehouse findByCode(@Param("code") String code);
    /**
     * 列表
     * @param params
     * @return
     */
    List<WarehouseVo> findAll(@Param("params") WarehouseSearchParam params);
    WarehouseVo findByName(@Param("name") String name);
    WarehouseVo findByProvinceAndCityAndDistrict(@Param("province") String province,@Param("city")  String city,@Param("district")  String district);
    /**
     * 分页
     * @param page
     * @param params
     * @return
     */
    IPage<WarehouseVo> findAll(Page page, @Param("params") WarehouseSearchParam params);

}
